# -*-coding:utf-8
# ProjectName: smalleel-api-tools
# FileName: randomUtil.py
# @Time :2023/1/11 14:04
# @Author :
# @Description:产生随机数据

import random


def get_random_name(description: str) -> str:
    """
    产生随机名称
    :param description:传入名称
    :return: str
    """

    return description + f"{random.randint(1, 999999)}"


def get_random_integer(number: int) -> int:
    """
    产生随机整数
    :param:number: 随机范围内的截止数，int
    :return:int
    """
    return random.randint(1, number)


def get_random_phone():
    first = random.choice(["135", "136", "185", "188", "186"])
    last = random.randint(10000000, 99999999)
    return first + str(last)


def get_random_char(length: int) -> int:
    """

    Args:产生指定长度的数字字符串
        length: 输入指定生成长度，int

    Returns:生成一个随机地指定长度的字符串

    """
    string = []
    for i in range(length):
        char = str(random.randint(0, 9))
        string.append(char)
    # 将列表转换成字符串
    string = ''.join(string)
    return string


if __name__ == '__main__':
    # print(get_random_phone())
    print("C" + get_random_char(12))
